210 DATA 1-ONES------,2-TWOS------,3-THREES----,4-FOURS-----,5-FIVES-----,6-SIXES-----,A-3 OF KIND-,B-4 OF KIND-,C-FULL HOUSE,D-SM.STRT---,E-LG.STRT---,F-YAHTZEE---,G-CHANCE----
220 RESTORE
230 HTAB 1: VTAB 1: PRINT "Y A H T Z E E"
240 Q = 911:S = 0
245 REM *ROLL DICE AND CHANGE SELECTED DICE
250 FOR X = 1 TO 5:H(X) = INT( RND(1) *6) +1: NEXT X
260 GOSUB 1760
270 VTAB 15: PRINT "YOUR ROLL IS..."H(1);H(2);H(3);H(4);H(5)
280 VTAB 16: PRINT CHR$(24)
290 VTAB 17: INPUT " HOW MANY CHANGES ";N$:N = VAL(N$)
300 VTAB 17: PRINT " "
310 IF N$ = "" THEN 290
320 IF N <0 OR N >5 THEN 290
330 IF N$ >"53" THEN N$ = "0"
340 IF N$ = "5" OR N$ = "0" THEN GOTO 360
350 PRINT " WHICH ";"(";N;")";" "
360 IF N = 5 THEN P(1) = 1:P(2) = 2:P(3) = 3:P(4) = 4:P(5) = 5: GOTO 450
370 IF N = 0 THEN S = 2: GOTO 460
380 FOR O = 1 TO N
390 GET P$(O): VTAB 18: PRINT " "
400 VTAB 15: HTAB (33 -N): PRINT " ";: IF P$(O) <"0" OR P$(O) >"5" THEN 390
1550 T3 = T3 +1:T4 = T4 +T2:T5 = T5 +1: PRINT "PRESS ANY KEY TO CONTINUE"
1560 GET L5$: GOSUB 1840
1570 GOTO 150
1580 REM *SETS PLAYER ONE'S SCORES TO STRINGS
1590 FOR A = 1 TO 13
1600 P1$(A) = STR$(P1(A))
1610 IF P1(A) = 0 THEN P1$(A) = " X"
1620 IF P1(A) = .5 THEN P1$(A) = " *"
1630 NEXT A
1640 RETURN
1650 REM *SETS PLAYER TWO'S SCORES TO STRINGS
1660 FOR A = 1 TO 13
1670 P2$(A) = STR$(P2(A))
1680 IF P2(A) = 0 THEN P2$(A) = " X"
1690 IF P2(A) = .5 THEN P2$(A) = " *"
1700 NEXT A
1710 RETURN
1720 REM *PLAYER TURN INDICATOR
1730 VTAB 14: HTAB 28: PRINT "^";" ": RETURN
1740 VTAB 14: HTAB 28: PRINT " ";"^": RETURN
1750 REM *SORT DICE INTO ORDER
1760 C = 0
1770 FOR Q = 1 TO 4
1780 IF H(Q) < = H(Q +1) THEN 1800
1790 T = H(Q):H(Q) = H(Q +1):H(Q +1) = T:C = C +1
1800 NEXT Q
1810 IF C >0 THEN 1760
1820 RETURN
1830 REM *TOTAL ALL SCORES AND DISPLAY SUMMARY
1840 HOME : FOR A = 1 TO 14:P3(A) = P3(A) +P1(A):P4(A) = P4(A) +P2(A): NEXT A
1850 READ A$: IF A$ = "START" THEN 1870
1860 IF A$ < >"START" THEN GOTO 1850
1870 PRINT " ";P1$,P2$
1880 FOR A = 1 TO 14: READ A$: PRINT A$;" ";: PRINT INT(P3(A)/T5 +.49), INT(P4(A)/T5 +.49): NEXT A
1890 IF HT < = P1(14) THEN HT = P1(14):HT$ = P1$
1900 IF LT > = P1(14) THEN LT = P1(14):LT$ = P1$
1910 IF HT < = P2(14) THEN HT = P2(14):HT$ = P2$
1920 IF LT > = P2(14) THEN LT = P2(14):LT$ = P2$
1930 PRINT : PRINT "LOWEST SCORE WAS BY ";LT$;"=";LT: PRINT "HIGHEST SCORE WAS BY ";HT$;"=";HT: PRINT P1$;"'S";" BONUS =";PO;" OF ";T5: PRINT P2$;"'S";" BONUS =";PT;" OF ";T5: PRINT P1$;"=";W4;" ";P2$;"=";W2;" ";"TIES=";W3
1940 PRINT "PRESS ANY KEY TO START NEW GAME": GET N$
1950 RESTORE : RETURN
1960 DATA START,1=,2=,3=,4=,5=,6=,A=,B=,C=,D=,E=,F=,G=,AV
1965 REM *DISPLAY INSTRUCTIONS
1970 HOME : VTAB 8: PRINT "HERE'S THE INSTRUCTIONS": PRINT : PRINT "THE GAME INVOLVES THE 'ROLLING' OF FIVE DICE AND GETTING COMBINATIONS THAT MATCHEACH OF THE 13 CATAGORIES. (E.G. 3 OF A KIND, LARGE STRAIGHT ETC.)"
1980 PRINT : PRINT "ON EACH TURN YOU GET TO ROLL THE DICE 3 TIMES AND CAN DECIDE ON ROLLS TWO AND THREE TO RE-ROLL JUST THE ONES YOU WANT.WHEN THE COMPUTER ASKS 'WHICH ONES', YOURESPOND WITH THE DIE NUMBER (1 TO 5 - LEFT TO RIGHT)."
1990 VTAB 22: PRINT "PUSH ANY KEY TO CONTINUE INSTRUCTIONS": GET N$
2000 HOME : VTAB 8: PRINT "AFTER THE LAST ROLL YOU MUST CHOOSE A CATAGORY (EVEN IF YOUR ROLL DOES NOT MATCH ONE). YOU MUST CHOOSE ONE, AND IF YOUR ROLL DOESN'T MATCH THEN THAT CATAGORY WILL JUST BE 'X' OUT (ZERO POINTS)."
2010 PRINT : PRINT "THE 'BONUS' CATAGORIES ARE 1 TO 6. YOU GET A BONUS OF 35 POINTS IF YOUR TOTAL FOR CATAGORIES 1 TO 6 IS 63 OR MORE."
2020 VTAB 22: PRINT "PUSH ANY KEY TO CONTINUE INSTRUCTIONS.": GET N$
2030 HOME : VTAB 1: PRINT "THE FOLLOWING ARE THE POINTS FOR EACH CATAGORY."
2040 PRINT : PRINT " (1-6) BONUS POINTS. DIES MATCHING": HTAB 12: PRINT "CATAGORY ARE ADDED"
2050 PRINT " (A) 3 OF A KIND. ALL DICE ARE": HTAB 12: PRINT "ADDED"
2060 PRINT " (B) 4 OF A KIND. ALL DICE ARE": HTAB 12: PRINT "ADDED"
2070 PRINT " (C) FULL HOUSE. (3 AND 2 OF ANY": HTAB 12: PRINT "KIND) = 35 PTS.
2080 PRINT " (D) SMALL STRAIGHT.4 IN SEQUENCE": HTAB 12: PRINT "= 35 POINTS"
2090 PRINT " (E) LARGE STRAIGHT.5 IN SEQUENCE": HTAB 12: PRINT "= 40 PTS."
2100 PRINT " (F) YAHTZEE. ALL 5 SAME.= 50 PTS.";
2110 PRINT " (G) CHANCE. ANY COMBINATION.": HTAB 12: PRINT "ALL DICE ADDED"
2120 VTAB 22: PRINT "PUSH ANY KEY TO CONTINUE INSTRUCTIONS.": GET N$
2130 HOME : VTAB 10: PRINT "NOTE: PUSHING 5 AT 'HOW MANY CHANGES', RE-ROLLS ALL THE DICE.": PRINT : PRINT "NOTE: PUSHING 0 AT 'HOW MANY CHANGES' PROMPTS THE 'WHICH OPTION'."
2150 VTAB 22: PRINT "PUSH ANY KEY TO START GAME": GET N$: RETURN